#include <stdio.h>

int gcd(int a,int b)
{
	while(1)
	{
		int c=a%b;
		if(c==0)
		return b;
		else
		{	
			a=b;
			b=c;
		}
	}
}
int main()
{
	int num1=0;
	int num2=0;
	scanf("%d %d",&num1,&num2);
	int ret=gcd(num1,num2);
	printf("最大公约数：%d",ret);
	return 0;
}